package com.spring.demo.core.entity;

import java.io.Serializable;
import java.util.Date;

public class Order implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Long id;

	private String name;

	private CustomerInfo customer;

	private Date createDate;

	private Status status;

	private Date updateDate;

	public Order() {
	}

	public Order(Long id, String name, CustomerInfo customer) {
		super();
		this.id = id;
		this.name = name;
		this.customer = customer;
		this.status = Status.MODIFIABLE;
		this.createDate = new Date();
		this.updateDate = this.createDate;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public CustomerInfo getCustomer() {
		return customer;
	}

	public void setCustomer(CustomerInfo customer) {
		this.customer = customer;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public static enum Status {
		MODIFIABLE("初始状态"), CHECKED_OUT("已检查"), POSTPONED("已延期"), DELIVERED(
				"已发货"), CANCELED("已取消");

		private String name;

		private Status(String name) {
			this.name = name;
		}

		public String getName() {
			return this.name;
		}
	}

}
